<template>
    <div class="app">
        <div class="app__head">
            <comp-navbar ref="navbar"></comp-navbar>
        </div>
        <div class="app__body">
            <router-view></router-view>
        </div>
    </div>

</template>

<script>
    import Vue from "vue";
    import VueRouter from "vue-router";
    import env from "./env";
    import common from "./common";
    import comps from "./comps";
    import pages from "./pages";
    import mixin from "./mixin";
    import { string, int } from "./util";
    export default {
        name: "app",
        title: env.projectName,
        nodes: [],
        childs: ["home", "stats", "work", "corp", "inspect", "joblife", "policy","policyUp", "news", "org", "system", "user","phone",],
        router: new VueRouter({ routes: [...pages, { path: "*", redirect: "/home" }] }),
        mixins: [mixin],
        data: () => ({
            screens:'',
            open:true
        }),
        methods: {},
        setup() {
            console.log(this.childs)
           let str2=location.href.substring(location.href.indexOf("#/")+2,location.href.length)
           this.screens = str2
           if(this.screens=="screens"){

                this.open = false
           }
            if (common) Vue.use(common);
            if (comps.length > 0) comps.forEach(({ name, component }) => Vue.component(name, component));
            new Vue(this).$mount("#app");
        },
    };
</script>

<style lang="scss">
    .app {
        width: 100vw;
        height: 100vh;
        color: black;
        font-size: 14px;
        font-weight: normal;
        font-family: sans-serif;
        line-height: 1.5;
        word-wrap: break-word;
        word-break: break-all;
        background-color: white;
        overflow: hidden;
    }

    .app__head {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .app__body {
        margin: 60px 0 0 180px;
        width: calc(100% - 180px);
        height: calc(100% - 60px);
    }
</style>
